<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>StellarDrift - 心声海洋页原型</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500&display=swap');

        :root {
            --phone-width: 430px;
            --phone-height: 932px;
            --primary-bg: #0D1B2A;
            --secondary-bg: #1B263B;
            --accent-gold: #FFD700;
            --text-light: #E0E1DD;
            --text-dark: #778DA9;
        }

        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f0f2f5;
            font-family: 'Noto Sans SC', sans-serif;
            overflow: hidden;
        }

        .phone-shell {
            width: var(--phone-width);
            height: var(--phone-height);
            background-color: #111;
            border-radius: 50px;
            padding: 12px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 0 10px #000;
            position: relative;
        }

        .screen {
            width: 100%;
            height: 100%;
            background: linear-gradient(180deg, var(--primary-bg) 0%, var(--secondary-bg) 100%);
            border-radius: 40px;
            position: relative;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* iPhone Mockup Elements */
        .notch {
            position: absolute;
            top: 12px;
            left: 50%;
            transform: translateX(-50%);
            width: 140px;
            height: 35px;
            background-color: #111;
            border-radius: 0 0 20px 20px;
            z-index: 100;
        }

        .home-indicator {
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            width: 140px;
            height: 5px;
            background-color: rgba(255, 255, 255, 0.4);
            border-radius: 5px;
            z-index: 100;
        }
        
        .side-buttons {
            position: absolute;
            left: -16px;
            top: 120px;
            width: 4px;
            height: 200px;
        }

        .side-buttons .btn {
            width: 100%;
            background-color: #111;
            border-radius: 4px 0 0 4px;
            margin-bottom: 25px;
        }
        .side-buttons .btn.volume-up { height: 60px; }
        .side-buttons .btn.volume-down { height: 60px; }

        .power-button {
            position: absolute;
            right: -16px;
            top: 200px;
            width: 4px;
            height: 100px;
            background-color: #111;
            border-radius: 0 4px 4px 0;
        }


        /* App Content */
        .app-container {
            flex: 1;
            position: relative;
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
        }

        /* Starry Night Background */
        .star {
            position: absolute;
            background-color: white;
            border-radius: 50%;
            animation: twinkle 5s infinite;
        }

        @keyframes twinkle {
            0%, 100% { opacity: 0.5; box-shadow: 0 0 2px 0px var(--text-light); }
            50% { opacity: 1; box-shadow: 0 0 5px 2px var(--text-light); }
        }

        /* Main Content & FAB */
        .main-content {
            flex: 1;
            display: flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            position: relative;
        }

        .lure-button {
            padding: 15px 30px;
            font-size: 18px;
            font-weight: 500;
            color: var(--primary-bg);
            background-color: var(--accent-gold);
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
            z-index: 10;
        }
        .lure-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
        }
        .lure-button:active {
            transform: translateY(0);
        }
        .lure-button:disabled {
            background-color: var(--text-dark);
            cursor: wait;
        }

        .bottle-card-container {
            position: absolute;
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transform: scale(0.9);
            transition: opacity 0.4s ease, transform 0.4s ease;
            pointer-events: none;
        }
        .bottle-card-container.visible {
            opacity: 1;
            transform: scale(1);
            pointer-events: all;
        }

        .bottle-card {
            width: 85%;
            padding: 30px;
            background-color: rgba(27, 38, 59, 0.7);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-radius: 20px;
            border: 1px solid rgba(119, 141, 169, 0.3);
            text-align: center;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        }
        .bottle-card-preview {
            font-size: 16px;
            color: var(--text-light);
            line-height: 1.6;
            height: 100px;
            overflow: hidden;
            position: relative;
            filter: blur(3px); /* Blur the text */
            user-select: none;
        }
        .bottle-card-preview::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 40%;
            background: linear-gradient(to top, rgba(27, 38, 59, 1), transparent);
        }

        .bottle-actions {
            margin-top: 25px;
            display: flex;
            gap: 15px;
        }

        .card-button {
            flex: 1;
            padding: 12px;
            border-radius: 25px;
            border: none;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .card-button.open {
            background-color: var(--accent-gold);
            color: var(--primary-bg);
        }
        .card-button.throw-back {
            background-color: transparent;
            border: 1px solid var(--text-dark);
            color: var(--text-light);
        }
        .card-button:active {
            transform: scale(0.96);
        }

        .fab-container {
            position: absolute;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 50;
        }

        .fab {
            width: 70px;
            height: 70px;
            background-color: var(--accent-gold);
            border-radius: 50%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
            transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
        }
        
        .fab:active {
            transform: scale(0.95);
            box-shadow: 0 2px 8px rgba(255, 215, 0, 0.6);
        }

        .fab .fab-text {
            color: var(--primary-bg);
            font-weight: 500;
            font-size: 14px;
            margin-top: 2px;
        }

        /* Bottle Icon inside FAB */
        .bottle-icon {
            width: 28px;
            height: 28px;
            border: 2px solid var(--primary-bg);
            border-radius: 45% 45% 15px 15px;
            position: relative;
        }
        .bottle-icon::before {
            content: '';
            position: absolute;
            top: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 12px;
            height: 4px;
            background-color: var(--primary-bg);
            border-radius: 2px;
        }

        /* Tab Bar (Simulating uView) */
        .tab-bar {
            width: 100%;
            height: 80px;
            background-color: rgba(27, 38, 59, 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-top: 1px solid rgba(119, 141, 169, 0.2);
            display: flex;
            justify-content: space-around;
            align-items: flex-start;
            padding-top: 10px;
            z-index: 50;
        }

        .tab-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            color: var(--text-dark);
            cursor: pointer;
            transition: color 0.3s ease;
        }

        .tab-item.active {
            color: var(--accent-gold);
        }

        .tab-item-icon {
            font-size: 24px;
            line-height: 1;
        }
        .tab-item-text {
            font-size: 12px;
            margin-top: 6px;
        }
        
        /* Profile Modal */
        .profile-modal-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 200;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }
        .profile-modal-overlay.visible {
            opacity: 1;
            pointer-events: all;
        }
        .profile-modal {
            width: 80%;
            background-color: var(--secondary-bg);
            border-radius: 20px;
            padding: 30px;
            text-align: center;
            color: var(--text-light);
            transform: scale(0.95);
            transition: transform 0.3s ease;
        }
        .profile-modal-overlay.visible .profile-modal {
            transform: scale(1);
        }
        .profile-avatar {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            background-color: var(--lighter-bg);
            margin: 0 auto 15px;
            font-size: 40px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .profile-nickname {
            font-size: 18px;
            font-weight: 500;
            margin-bottom: 30px;
        }
        .logout-button {
            padding: 12px 40px;
            background-color: var(--accent-gold);
            color: var(--primary-bg);
            border: none;
            border-radius: 25px;
            font-weight: 500;
            cursor: pointer;
        }

    </style>
</head>
<body>

    <div class="phone-shell">
        <div class="side-buttons">
            <div class="btn volume-up"></div>
            <div class="btn volume-down"></div>
        </div>
        <div class="power-button"></div>
        <div class="screen">
            <div class="notch"></div>
            
            <div class="app-container" id="app">
                <!-- Stars will be generated here by JS -->
                
                <div class="main-content">
                    <button class="lure-button" id="lureButton">捞一个瓶子</button>
                    
                </div>

                <div class="fab-container">
                    <div class="fab" id="fab">
                        <div class="bottle-icon"></div>
                        <span class="fab-text">扔一个</span>
                    </div>
                </div>

                <div class="tab-bar">
                    <div class="tab-item active" data-page="home">
                        <span class="tab-item-icon">🌊</span>
                        <span class="tab-item-text">海洋</span>
                    </div>
                    <div class="tab-item" data-page="bottles">
                        <span class="tab-item-icon">🍾</span>
                        <span class="tab-item-text">我的瓶子</span>
                    </div>
                    <div class="tab-item" data-page="profile">
                        <span class="tab-item-icon">🧑‍🚀</span>
                        <span class="tab-item-text">个人中心</span>
                    </div>
                </div>
            </div>

            <div class="home-indicator"></div>

            <!-- Profile Modal -->
            <div class="profile-modal-overlay" id="profileModal">
                <div class="profile-modal">
                    <div class="profile-avatar">🧑‍🚀</div>
                    <div class="profile-nickname">匿名的宇航员</div>
                    <button class="logout-button" id="logoutButton">注销</button>
                </div>
            </div>
        </div>
    </div>

<script>
document.addEventListener('DOMContentLoaded', function() {
    const app = document.getElementById('app');
    const mainContent = document.querySelector('.main-content');
    const fab = document.getElementById('fab');
    const tabBar = document.querySelector('.tab-bar');

    // New elements for lure interaction
    const lureButton = document.getElementById('lureButton');

    // New elements for profile modal
    const profileModal = document.getElementById('profileModal');
    const logoutButton = document.getElementById('logoutButton');

    // 1. Generate starry background
    function createStars() {
        const starCount = 100;
        for (let i = 0; i < starCount; i++) {
            let star = document.createElement('div');
            star.className = 'star';
            star.style.width = `${Math.random() * 2 + 1}px`;
            star.style.height = star.style.width;
            star.style.top = `${Math.random() * 100}%`;
            star.style.left = `${Math.random() * 100}%`;
            star.style.animationDelay = `${Math.random() * 5}s`;
            star.style.animationDuration = `${Math.random() * 3 + 2}s`;
            app.prepend(star);
        }
    }

    // 2. Create ripple effect on touch
    function createRipple(event) {
        const ripple = document.createElement("span");
        ripple.style.position = 'absolute';
        ripple.style.backgroundColor = 'rgba(255, 215, 0, 0.7)';
        ripple.style.borderRadius = '50%';
        ripple.style.transform = 'scale(0)';
        ripple.style.animation = 'ripple 600ms linear';
        
        const rect = mainContent.getBoundingClientRect();
        const x = event.clientX - rect.left;
        const y = event.clientY - rect.top;

        ripple.style.left = `${x}px`;
        ripple.style.top = `${y}px`;
        ripple.style.width = '10px';
        ripple.style.height = '10px';

        mainContent.appendChild(ripple);
        
        ripple.addEventListener('animationend', () => {
            ripple.remove();
        });
    }

    const rippleStyle = document.createElement('style');
    rippleStyle.innerHTML = `
        @keyframes ripple {
            to {
                transform: scale(20);
                opacity: 0;
            }
        }
    `;
    document.head.appendChild(rippleStyle);
    
    mainContent.addEventListener('click', createRipple);


    // 3. Handle FAB click - Navigate to Create Bottle Page
    fab.addEventListener('click', () => {
        console.log('FAB Clicked: Navigating to create bottle page.');
        // alert('准备进入瓶子创建页面...');
        window.location.href = 'CreateBottlePage.html';
    });

    // 4. Handle Lure (luring) interaction
    lureButton.addEventListener('click', () => {
        lureButton.disabled = true;
        lureButton.textContent = '捞取中...';

        setTimeout(() => {
            // Directly navigate to the detail page
            window.location.href = 'BottleDetailPage.html';
        }, 1000); // Simulate network delay
    });

    // 5. Handle Tab Bar navigation
    tabBar.addEventListener('click', (event) => {
        const clickedItem = event.target.closest('.tab-item');
        if (!clickedItem) return;

        const page = clickedItem.dataset.page;
        console.log(`Navigating to: ${page}`);
        
        if (page === 'profile') {
            profileModal.classList.add('visible');
            return; // Stay on the current page but show modal
        }
        
        if (page === 'bottles') {
            window.location.href = 'MyBottlesPage.html';
            return;
        }

        // Remove active class from all items
        document.querySelectorAll('.tab-item').forEach(item => {
            item.classList.remove('active');
        });

        // Add active class to the clicked item
        clickedItem.classList.add('active');

        // In a real app, you would navigate to the corresponding page here.
    });

    // 6. Handle Modal interactions
    profileModal.addEventListener('click', (event) => {
        // Close modal if clicking on the overlay background
        if (event.target === profileModal) {
            profileModal.classList.remove('visible');
        }
    });
    
    logoutButton.addEventListener('click', () => {
        alert('正在注销...');
        setTimeout(() => {
            window.location.href = 'LoginPage.html';
        }, 1000);
    });

    // Initialize
    createStars();
});
</script>

</body>
</html> 